package org.wisdom.data.jpa.entity;

import lombok.Data;
import lombok.EqualsAndHashCode;
import org.hibernate.annotations.GenericGenerator;
import org.springframework.core.annotation.Order;

import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;

/**
 * 所有实体的基类
 * 
 * @author zhangzhiyan
 * @date 2021/06/24 21:59
 **/
@EqualsAndHashCode(callSuper = true)
@Data
@MappedSuperclass
public class BaseEntity extends WisdomEntity {

    private static final long serialVersionUID = 1L;
    /**
     * 主键
     */
    @Id
    @GeneratedValue(generator = "uuid2")
    @GenericGenerator(name = "uuid2", strategy = "org.wisdom.data.jpa.id.WisdomIdGenerator")
    @Order(0)
    private String id;
}
